export default {
  data(){
    return {
      selectData:[],
      search:{
        search:"",
        year:"",
        category:"",
      },
      searchData:[
        {name:"关键词",key:"search",type:"input"},
        {name:"年份",key:"year",type:"select",array:[]},
        {name:"报刊类别",key:"category",type:"select",array:[]},
      ],
    }
  },
  methods:{
    /**
     * @name 获取下拉
     */
    getSelectData(){
      _g.apiPost("teacher/getselect",{name:"academic",fields:["year","category"]}).then(res=>{
        this.$set(this.searchData[1],"array",res.data.year)
        this.$set(this.searchData[2],"array",res.data.category)
      })
    }
  },
  mounted() {
    this.getSelectData()
    if(bus._events.import_flash!==null){
      bus.$off("import_flash")
    }
    bus.$on("import_flash",()=>{
      this.getList()
    })
  },
}